﻿/******************************************************************************
 * Copyright (C) 2015  671643387@qq.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *****************************************************************************/

#ifndef GAME_GAME_SQLSTORAGES_H_
#define GAME_GAME_SQLSTORAGES_H_

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif

/************************************************************************/
/* 数据库数据                                                           */
/************************************************************************/

#include <NodeCpp/Macros.h>
#include <NodeCpp/Singleton.h>
#include "Shared/Storage/SQLStorage.h"
using NodeCpp::Singleton;

class ObjectManager;

class SQLStorages
{
public:
	SQLStorages(void);
	~SQLStorages(void);

private:
    friend class ObjectManager;

    /* 加载数据 */
    bool _LoadCreatureTemplates(void);
    bool _LoadInstanceTemplate(void);
    bool _LoadItemPrototypes(void);

    /* 数据集 */
    SQLStorage CreatureStorage_;
    SQLStorage InstanceTemplate_;
    SQLStorage ItemStorage_;
	DISALLOW_COPY_AND_ASSIGN(SQLStorages);
};
#define sSQLStorages Singleton<SQLStorages>::Instance()

#endif /* GAME_GAME_SQLSTORAGES_H_ */
